package com.sunnyebuy.merchant.util;

/**
 * <p>
 * Title: StringUtil.java
 * </p>
 * 
 * <p>
 * Description: com.sunnyebuy.merchant.util
 * </p>
 * 
 * <p>
 * Copyright: Copyright (c) 2008-2012 All rights reserved.
 * </p>
 * 
 * <p>
 * Created: 2012-1-31 下午3:14:25
 * </p>
 * 
 * @author Wenzhong Gu
 * 
 * @version 1.0
 */
public class StringUtil {

	public static boolean isEmpty(String str) {
		return str == null || str.length() == 0;
	}

	public static boolean isNotEmpty(String str) {
		return !StringUtil.isEmpty(str);
	}

	public static boolean isBlank(String str) {
		if (str == null || str.trim().length() == 0) {
			return true;
		}
		return false;
	}

	public static boolean isNotBlank(String str) {
		return !StringUtil.isBlank(str);
	}

	public static String trim(String str) {
		return str == null ? null : str.trim();
	}

	public static boolean equalsIgnoreCase(String str1, String str2) {
		return str1 == null ? str2 == null : str1.equalsIgnoreCase(str2);
	}

}